<cfoutput>
	
	<cfset states = application.s.resourceService.getStates() />
	<cfset user = application.s.craftivityService.getUser(userID=request.session.user.id) />
	<cfset business = application.s.craftivityService.getBusiness(userID=user.id) />
	
	<cfsavecontent variable="page">
		<div class="header variable-width">
			<i class="fa fa-home" onclick="Main.nav('home');"></i>
			<div class="header-title">set up your business</div>
			#$.render.img(path="craftivity/widget_icons/worksheet2.png")#</br>
		</div>
		
		#$.render.form(name='setup_form',class='widget widget-form',method='craftivityController.saveBusiness')#
			<div class="widget-title"><i class="fa fa-exclamation-circle"></i>About You<!--- <i class="fa fa-gear control"></i> ---></div>
			<div class="widget-title sub first">Business</div>
			
			#application.v.craftivityView.renderInput(name="name",label="Business Name",value=business.name,validate="required",varchar=100)#
			#application.v.craftivityView.renderSelect(name="stateID",label="State",value=business.state_ID,query=states,instructions="Not U.S. or Canada? Leave this empty.")#
			#$.run.it('calendarView.renderContinentSelect',{value=business.continent})#
			#$.run.it('calendarView.renderTimezoneSelect',{value=business.timezone})#
			<!--- <cfset dstMessage = "Check if you live in an are that observes Daylight Savings Time." />
			<div class="daylight-savings form-input hidden">
				<div class="form-input-label" title="#dstMessage#">Observe DST</div>
				<div class="form-input-value">
					<input name="dst" type="checkbox" value="true" title="#dstMessage#" <cfif business.dst eq 1>checked</cfif> />
					<span class="form-input-input-value user">
						<cfif business.dst eq 1>Yes<cfelse>No</cfif>
					</span>
					<div class="form-input-instructions">
						<i class="fa fa-info-circle"></i>
						Daylight Savings Time
					</div>
				</div>
			</div> --->
			#application.v.craftivityView.renderInput(name="website",value=business.website,varchar=100)#
			#application.v.craftivityView.renderTextarea(name="description",value=business.description,validate="maxLength1499")#
			<input type="hidden" name="businessID" value="#business.id#" />

			<div class="widget-title sub">profile</div>
			
			#application.v.craftivityView.renderInput(name="first_name",value=user.first_name,varchar=100)#
			#application.v.craftivityView.renderInput(name="middle_name",value=user.middle_name,varchar=100)#
			#application.v.craftivityView.renderInput(name="last_name",value=user.last_name,varchar=100)#
			#application.v.craftivityView.renderInput(name="email",value=user.email,instructions="You cannot currently change your email address. Please contact us via the Support and Feedback tool for help.",varchar=100)#
			#application.v.craftivityView.renderTextarea(name="bio",value=user.bio,validate="maxLength1499")#
			<input type="hidden" name="userID" value="#user.id#" />
			<div class="buttons">
				<button type="button" name="edit" class="left" onclick="Widget.edit(this);">edit</button>
				<button type="submit" name="save" class="red right">save</button>
				<button type="button" name="cancel" class="grey right" onclick="Widget.cancel(this);">cancel</button>
			</div>
		</form>
		
		<!--- todo: bring back categories --->
		<!--- #$.render.form(name='setup_form',class='widget widget-form',method='craftivityController.saveBusinessTags')#
			<div class="widget-form-title">Categorize your business</div>
			
			#application.v.craftivityView.renderSelect(
				name="stateIDx",
				label="Category",
				value=business.state_ID,
				query=states
			)#
			#application.v.craftivityView.renderSelect(
				name="stateIDx",
				label="Subcategories",
				value=business.state_ID,
				query=states
			)#
			#application.v.craftivityView.renderSelect(
				name="stateIDx",
				label="Commitment",
				value=business.state_ID,
				query=states
			)#
			#application.v.craftivityView.renderSelect(
				name="stateIDx",
				label="Revenue",
				value=business.state_ID,
				query=states,
				instructions="This information is used by Craftivity to provide you with content tailored for your business. It is not shared with anyone else."
			)#
			<input type="hidden" name="businessID" value="#business.id#" />
			
			<div class="widget-form-title">Tag Your Business</div>
			</br>under construction</br>
			
			<div class="widget-form-title">Tag Your Services</div>
			</br>under construction</br>
			
			<button type="button" name="edit" class="left" onclick="Widget.edit(this);">edit</button>
			<button type="button" name="save" class="red right">save</button>
			<button type="button" name="cancel" class="grey right" onclick="Widget.cancel(this);">cancel</button>
		</form> --->

	</cfsavecontent>
	
	#application.v.craftivityView.renderPage(page)#
</cfoutput>